<template>
  <div>
    <button @click="edit">edit</button>
    <div v-for="item of list" :key="item.id">
      <h3>{{item.name}}</h3>
    </div>

      <child-one v-if="type===one"></child-one>
      <child-two v-if="type===two"></child-two>
  </div>
</template>

<script>

export default {
  data(){
    return{
      list:[
        { name:'lin', id: 11 },
        { name:'huang', id: 12 },
        { name:'liu', id: 13 }
      ]
    }
  },
  methods:{
    edit(){
      // this.list[0] = {name:'zeng', id:33}
      // this.list.length = 0
      this.list = [{name:'zeng', id:33}]
      console.log(this.list)
    }
  }
}
</script>
